/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.simpla.ufaerdigt;

import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TableLayout;
import android.widget.TextView;
import eks.matador.Matadorspil;
import eks.matador.Matadorspil;
import org.simpla.SimplaActivity;

/**
 *
 * @author Jacob Nordfalk
 */
public class Matadoraktivitet2_ufaerdig extends SimplaActivity {

  Matadorspil spil = new Matadorspil();

  @Override
	public void simplaMain() {

    TextView textView = simpla.createTextView("Velkommen til matatorspillet!\n");
		simpla.systemOutToTextView(textView);

    ScrollView scrollView = new ScrollView(this);
    scrollView.addView(textView);

    LinearLayout række = new LinearLayout(this);
    Button buttonSpil = new Button(this);
    buttonSpil.setText("Spil tur");
    Button buttonAfslut = new Button(this);
    buttonAfslut.setText("Afslut");
    række.addView(buttonSpil);
    række.addView(buttonAfslut);

    LinearLayout linearLayout = new LinearLayout(this);
    linearLayout.setOrientation( LinearLayout.VERTICAL);
    linearLayout.addView(scrollView);
    ((LinearLayout.LayoutParams) scrollView.getLayoutParams()).weight = 1;
    linearLayout.addView(række);

		simpla.setContentView(linearLayout);

    buttonSpil.setOnClickListener(new OnClickListener() {
      public void onClick(View arg0) {
        spil.spilEnTur();
      }
    });

    buttonAfslut.setOnClickListener(new OnClickListener() {
      public void onClick(View arg0) {
        finish();
      }
    });

	}
}
